
public class ContoCorrente {
	private double saldo;
	
	public synchronized double getSaldo() {
		return saldo;
	}
	
	public synchronized void versa(double x) {
		saldo+=x;
	}
	
	public  void bonifico(double x, 
			ContoCorrente origine) {
		synchronized (this) { 
			saldo += x;
		}
		origine.versa(-x);
	}
}
